// 首页请求图片路由
const express = require('express');
const index = express.Router();
const pool = require('../pool.js');
//1.首页图片
index.get('/', (req, res, next) => {
    pool.query('select * from ljk_laptop', (err, data) => {
        //处理错误
        if (err) {
            next(err);
            return;
        }
        //查看数据库返回的数据data
        console.log(data);
        res.send({"code": 1,"msg": "已查到数据","data": data});
    });
});

//导出
module.exports=index;

